package frsf.cidisi.exercise.arq.search;

import java.util.HashMap;

import frsf.cidisi.faia.solver.search.IEstimatedCostFunction;
import frsf.cidisi.faia.solver.search.NTree;

/**
 * This class allows to define a function to be used by any
 * informed search strategy, like A Star or Greedy.
 */
public class Heuristic implements IEstimatedCostFunction {

    /**
     * It returns the estimated cost to reach the goal from a NTree node.
     */
    public double getEstimatedCost(NTree node) {
        EstadoArqueologo agState = (EstadoArqueologo) node.getAgentState();
        HashMap<String, Integer>distMin=EstadoArqueologo.distMinimas;
        Integer distADestino=distMin.get(agState.getposicion());
        return new Double(distADestino);
        
    }
}
